package day4.demo2_lambd;

import org.junit.Test;

import java.util.Comparator;
import java.util.List;

public class A {
    @Test
    public void m1() {
        Runnable r = new Runnable() {
            @Override
            public void run() {
                System.out.println("............");
            }
        };
        new Thread(r).start();
    }

    @Test
    public void m2() {
        Runnable r = () -> {
            System.out.println("............");
        };
        new Thread(r).start();
    }

    @Test
    public void m3() {
        Comparable<String> c = new Comparable<String>() {
            @Override
            public int compareTo(String o) {
                System.out.println("........");
                return 0;
            }
        };
    }

    @Test
    public void m4() {
        Comparable c = o -> {
            System.out.println("........");
            return 0;
        };
        System.out.println(c.compareTo("ddd"));
    }
    @Test
    public void m5() {
        Comparable<String> c = o -> o.length();
        System.out.println(c.compareTo("ddd"));
    }

    @Test
    public void m6(){
        Comparator<Integer> c = new Comparator<>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o1.compareTo(o2);
            }
        };
    }
    @Test
    public void m7(){
        Comparator<Integer> c = (o1, o2)-> o1.compareTo(o2);
        List list=null;
//        list.sort();

    }
}
